package com.way.Java多线程编程核心技术v2.chapter02_对象及变量的并发访问._2_2_synchronized同步语句块.细化验证3个结论;

/**
 * @author 魏彪
 */
public class Test01 {

    public static void main(String[] args) {

        Service02 service02 = new Service02();

        /**
         * 已经加锁，当其他线程执行x对象中
         * synchronized同步方法时呈同步效果
         */
        MyObject01 object01 = new MyObject01();

        ThreadC c = new ThreadC(service02, object01);
        c.setName("C");
        c.start();

        ThreadD d = new ThreadD(object01);
        d.setName("D");
        d.start();
    }
}
